package com.sample.thread.toilet;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * <p>Description: </p>
 *
 * @author zg
 * @version v1.0.0
 * @since 2024/8/22
 **/
@NoArgsConstructor
@Getter
public class Person extends Thread{

    private Integer depId;//部门id
    private String empName;//员工姓名

	public Person(Integer depId, String empName) {
            this.setName("D" + depId + "-" + empName);
            this.depId = depId;
            this.empName = empName;
        }

        @Override
        public void run() {
            //员工根据所在部门id找到部门的厕所
            Toilet toilet = ToiletTester.DepToilets.get(depId);
            toilet.enter(this);//进入
            //super.run();
        }


}
